<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui" template="template.xhtml">

	<ui:define name="main">
		<div class="header header_professor_acesso" />
		<h:form prependid="false" id="formDashboardProfessor">
			<p:panel id="painelConsulta"
				header="#{msgs.dashboard_professor}#{msgs.dois_pontos}#{dashboardProfessorBean.professor.nome}"
				styleClass="painelCadastro">
				<p:dataTable var="turma" value="#{dashboardProfessorBean.turmas}"
					onRowSelectUpdate="formDashboardProfessor" selectionMode="single"
					selection="#{dashboardProfessorBean.turmaSelecionada}"
					emptyMessage="#{msgs.pesquisa_vazia}#{msgs.dois_pontos}"
					paginator="true" paginatorPosition="bottom"
					firstPageLinkLabel="Primeira" previousPageLinkLabel="Anterior"
					nextPageLinkLabel="Proxima" lastPageLinkLabel="ultima" rows="5">
					<f:facet name="header">
						<h:outputText value="#{msgs.turmas}" styleClass="letra1" />
					</f:facet>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.descricao_turma}#{msgs.dois_pontos}"
						filterBy="#{turma.descTurma}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{turma.descTurma}" styleClass="letra1" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.periodo}#{msgs.dois_pontos}"
						filterBy="#{turma.fkPeriodo.descPeriodo}"
						filterMatchMode="contains" footerText="#{msgs.contem}">
						<h:outputText value="#{turma.fkPeriodo.descPeriodo}" />
					</p:column>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.serie}#{msgs.dois_pontos}"
						filterBy="#{turma.fkSerie.descSerie}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{turma.fkSerie.descSerie}" />
					</p:column>

				</p:dataTable>
			</p:panel>

			<h:panelGrid styleClass="painelBotoes" columns="2">
				<p:commandButton value="#{msgs.botao_recados}"
					action="consulta_recados_professor" ajax="false"
					disabled="#{empty dashboardProfessorBean.turmaSelecionada}" />
				<p:commandButton value="#{msgs.botao_enviar_nota_agenda}"
					action="cadastro_lcto_agenda" ajax="false"
					disabled="#{empty dashboardProfessorBean.turmaSelecionada}" />
			</h:panelGrid>
			<p:panel styleClass="painelConsulta"
				rendered="#{not empty dashboardProfessorBean.turmaSelecionada}">
				<p:dataTable var="matricula"
					value="#{dashboardProfessorBean.turmaSelecionada.matriculaList}"
					selectionMode="single" onRowSelectUpdate="formDashboardProfessor"
					selection="#{dashboardProfessorBean.matriculaSelecionada}"
					emptyMessage="#{msgs.pesquisa_vazia}#{msgs.dois_pontos}"
					paginator="true" paginatorPosition="bottom"
					firstPageLinkLabel="Primeira" previousPageLinkLabel="Anterior"
					nextPageLinkLabel="Proxima" lastPageLinkLabel="ultima" rows="5">
					<f:facet name="header">
						<h:outputText
							value="#{msgs.alunos_turma}#{msgs.dois_pontos}#{dashboardProfessorBean.turmaSelecionada.descTurma}"
							styleClass="letra1" />
					</f:facet>
					<p:column style="width:150px;text-align:center"
						headerText="#{msgs.nome_aluno}#{msgs.dois_pontos}"
						filterBy="#{matricula.ra.nome}" filterMatchMode="contains"
						footerText="#{msgs.contem}">
						<h:outputText value="#{matricula.fkRa.nome}" styleClass="letra1" />
					</p:column>
				</p:dataTable>

				<h:panelGrid styleClass="painelBotoes" columns="2">
					<p:commandButton value="#{msgs.botao_enviar_recado}"
						disabled="#{empty dashboardProfessorBean.matriculaSelecionada}"
						action="#{recadosBean.iniciarEnvioRecadoProfessor(dashboardProfessorBean.matriculaSelecionada.fkRa,dashboardProfessorBean.professor)}"
						ajax="false" />
				</h:panelGrid>
			</p:panel>
			<h:panelGrid style="height:100px" columns="2">
			</h:panelGrid>

		</h:form>

	</ui:define>
</ui:composition>